<template>
	<view>
		<u-navbar title="设置" :autoBack="true" bgColor="#fff" :fixed="false"></u-navbar>
		<view>
			<u-cell-group :customStyle="{'background':'#fff'}">
				<u-cell title="关于我们" url="/pages/common/common?type=1" isLink></u-cell>
				<u-cell title="协议" url="/pages/common/common?type=2" isLink></u-cell>
				<u-cell title="玩法攻略" url="/pages/home/playing" isLink></u-cell>
			</u-cell-group>
		</view>
		<view class="submit">
			<u-button @click="submit" type="error" text="退出登录" shape="circle"></u-button>
		</view>

		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	import {
		mapActions
	} from "vuex";
	export default {
		data() {
			return {

			}
		},
		methods: {
			...mapActions(['setUserLogout']),
			async submit() {
				let vm = this;
				await this.setUserLogout();
				vm.$refs.uToast.show({
					type: 'success',
					message: '退出成功',
					complete() {
						vm.loading = false;
						uni.reLaunch({
							url:'/pages/home/home'
						})
					}
				})
			},
		}
	}
</script>

<style>
	.submit {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		background-color: #fff;
		padding: 30rpx;
		box-sizing: border-box;
	}
</style>